package com.woniuxy.client;


import com.woniuxy.dto.ResponseData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "flowable-server", url = "http://localhost:8081/customer-workflow")
public interface FlowableFeign {
    @GetMapping("/tasks/pending")
    ResponseData<?> getPendingTasks(@RequestParam("userName") String userName);

    @PostMapping("/tasks/approve")
    ResponseData<?> approveTask(@RequestParam("processInstanceId") String processInstanceId);

    @PostMapping("/tasks/reject")
    ResponseData<?> rejectTask(@RequestParam("processInstanceId") String processInstanceId, @RequestParam("reason") String reason);

    @GetMapping("/tasks/completed")
    ResponseData<?> getCompletedTasks(@RequestParam("userName") String userName);

}
